// 期刊名称
export const formatJournalTitle = (row) => {
  return row.journalTitle + '\n' + row.abbrJournal
}
export const formatJcrJson = (row) => {
  if (row.jcr_Json) {
    const parsedData = JSON.parse(row.jcr_Json)
    // 最后一个sub
    return parsedData[parsedData.length - 1].sub
  } else {
    return '-'
  }
}
export const formatAnnualPublication = (row) => {
  if (row.annualPublication === 0) {
    return '-'
  } else {
    return row.annualPublication
  }
}
export const formatSubZone = (row) => {
  if (row.subZone === 0) {
    return '-'
  } else {
    return row.subZone + '区'
  }
}
export const formatTotalReviewRatio = (row) => {
  if (!row.totalReviewRatio) {
    return '-'
  } else {
    return `${row.totalReviewRatio}%`
  }
}
// 综述占比
export const formatOpenRatio = (row) => {
  if (!row.open_ratio) {
    return '-'
  } else {
    // // 保留两位小数
    return (row.open_ratio * 100).toFixed(2) + '%'
  }
}

export const formatOpenAccess = (row) => {
  return row.openAccess === 0 ? '否' : '是'
}
